package com.pokeoffice.pokemon;

/**
 * The Enum Type.
 */
public enum Type {
	
	/** The NORMAL. */
	NORMAL, 
 /** The FIGHTING. */
 FIGHTING, 
 /** The FLYING. */
 FLYING, 
 /** The POISON. */
 POISON, 
 /** The GROUND. */
 GROUND, 
 /** The ROCK. */
 ROCK, 
 /** The BUG. */
 BUG, 
 /** The GHOST. */
 GHOST, 
 /** The FIRE. */
 FIRE, 
 /** The WATER. */
 WATER, 
 /** The GRASS. */
 GRASS, 
 /** The ELECTRIC. */
 ELECTRIC, 
 /** The PSYCHIC. */
 PSYCHIC, 
 /** The ICE. */
 ICE, 
 /** The DRAGON. */
 DRAGON, 
 /** The NONE. */
 NONE;

	/**
	 * The multiplier when this type fights the defending: [NORMAL, FIGHTING,
	 * FLYING, POISON, GROUND, ROCK, BUG, GHOST, FIRE, WATER, GRASS, ELECTRIC,
	 * PSYCHIC, ICE, DRAGON] types.
	 * 
	 * @return an array of doubles of length 15, containing the attack
	 *         multiplier when this type attacks the corresponding type in the
	 *         array
	 */
	public double[] getMultiplier() {
		switch (this) {
		case NORMAL:
			return new double[] { 1.0, 1.0, 1.0, 1.0, 1.0, 0.5, 1.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 };
		case FIGHTING:
			return new double[] { 2.0, 1.0, 0.5, 0.5, 1.0, 2.0, 0.5, 0.0, 1.0, 1.0, 1.0, 1.0, 0.5, 2.0, 1.0 };
		case FLYING:
			return new double[] { 1.0, 2.0, 1.0, 1.0, 1.0, 0.5, 2.0, 1.0, 1.0, 1.0, 2.0, 0.5, 1.0, 1.0, 1.0 };
		case POISON:
			return new double[] { 1.0, 1.0, 1.0, 0.5, 0.5, 0.5, 2.0, 0.5, 1.0, 1.0, 2.0, 1.0, 1.0, 1.0, 1.0 };
		case GROUND:
			return new double[] { 1.0, 1.0, 0.0, 2.0, 1.0, 2.0, 0.5, 1.0, 2.0, 1.0, 0.5, 1.0, 1.0, 1.0, 1.0 };
		case ROCK:
			return new double[] { 1.0, 0.5, 2.0, 1.0, 0.5, 1.0, 2.0, 1.0, 2.0, 1.0, 1.0, 2.0, 1.0, 2.0, 1.0 };
		case BUG:
			return new double[] { 1.0, 0.5, 0.5, 2.0, 1.0, 1.0, 1.0, 1.0, 0.5, 1.0, 2.0, 1.0, 2.0, 1.0, 1.0 };
		case GHOST:
			return new double[] { 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.0, 1.0, 1.0, 1.0, 1.0, 0.0, 1.0, 1.0 };
		case FIRE:
			return new double[] { 1.0, 1.0, 1.0, 1.0, 1.0, 0.5, 2.0, 1.0, 0.5, 0.5, 2.0, 1.0, 1.0, 2.0, 0.5 };
		case WATER:
			return new double[] { 1.0, 1.0, 1.0, 1.0, 2.0, 2.0, 1.0, 1.0, 2.0, 0.5, 0.5, 1.0, 1.0, 1.0, 0.5 };
		case GRASS:
			return new double[] { 1.0, 1.0, 0.5, 0.5, 2.0, 2.0, 0.5, 1.0, 0.5, 2.0, 0.5, 1.0, 1.0, 1.0, 0.5 };
		case ELECTRIC:
			return new double[] { 1.0, 1.0, 2.0, 1.0, 0.0, 1.0, 1.0, 1.0, 1.0, 2.0, 0.5, 0.5, 1.0, 1.0, 0.5 };
		case PSYCHIC:
			return new double[] { 1.0, 1.0, 1.0, 2.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 0.5, 1.0, 1.0 };
		case ICE:
			return new double[] { 1.0, 2.0, 2.0, 1.0, 2.0, 1.0, 1.0, 1.0, 1.0, 0.5, 2.0, 1.0, 1.0, 0.5, 2.0 };
		case DRAGON:
			return new double[] { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 2.0 };
		case NONE:
			return new double[] { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 };
		default:
			return new double[] { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 };
		}
	}
}
